<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<tpl> $NCharset </tpl>" />

<title><tpl> $langCShopNCSystem </tpl></title>
<tpl> include file ='sys_head_config.html'</tpl>
</head>
<body>

<div class="tabbar">
  <ul class="tab_btns" id="COPYYH2">
    <li class="current"><a href="html.manage.php?action=list"><span><tpl> $langIStaticManage </tpl></span></a></li>
  </ul>
	<div class="tab_notes" id="copyyh0">
		<ul class="notesbg block"><span><h4>
		<div style="float:left">
		<tpl> $langIPageStaticOperator </tpl> 
		</div>
		  <div class="btn_left" style="margin-top:5px">
		<input type="button" value="<tpl> $langIAllCreateStatic </tpl>" onclick="all_cache();" class="btn_submit"/>
		</div>
		<div style="float:left">
		<tpl> $langIIfOpenTemplateCache </tpl>
		</div>
		
		  <div class="btn_left"style="margin-top:5px">
		 <input type="button" value="<tpl> $langICleanCache </tpl>" onclick="clean_cache();" class="btn_submit"/>
		 </div>
		 </h4></span></ul>
	</div>
	<!-- 显示提示信息 -->
	<div id="message"></div>
	<!-- 显示提示信息end -->
</div>

<div id="product-help" class="admincp_form" style="top:88px;">
<div id="result_content">
<table class="from_table">
	<tr>
		<th class="th2"><tpl> $langINews </tpl>：</th>
		<td width="265" class="td1">
		  <span class="btn_left">
		<input type="button" value="<tpl> $langINews </tpl>" onclick="news_html();" class="btn_submit"/>
		</span>
		</td>	
		<th class="th2"><tpl> $langIFooterBasicCote </tpl>：</th>
		<td width="265" class="td1">
		  <span class="btn_left">
		<input type="button" value="<tpl> $langIFooterBasicCoteCreateStatic </tpl>" onclick="section_html();" class="btn_submit"/></span>
		</td>
	</tr>
	<tr>
		<th class="th2"><tpl> $langIAdv </tpl>：</th>
		<td width="265" class="td1">  <span class="btn_left">
		<input type="button" value="<tpl> $langIAdv </tpl>" onclick="adv_html();" class="btn_submit"/></span>
		</td>
		<th class="th2"><tpl> $langIFooter </tpl>：</th>
		<td width="265" class="td1">  <span class="btn_left">
		<input type="button" value="<tpl> $langIShopFooterCreateStatic </tpl>" onclick="make_html('footer');" class="btn_submit"/></span>
		</td>	
	</tr>
	<tr>
		<th class="th2"><tpl> $langIFirendLink </tpl>：</th>
		<td width="265" class="td1">  <span class="btn_left">
		<input type="button" value="<tpl> $langIFirendLinkCreatestatic </tpl>" onclick="make_html('link');" class="btn_submit"/></span>
		</td>	
		<th class="th2"><tpl> $langIHomeChannel </tpl>：</th>
		<td width="265" class="td1">  
		<tpl> if $config_channel_html eq '1' </tpl><!-- 开启静态 -->
			<span class="btn_left"><input type="button" value="<tpl> $langIHomeChannelCreateStatic </tpl>" onclick="channel_html();" class="btn_submit"/></span>
		<tpl> else </tpl>
			<span style="color: #FF0000;font-weight: bold;"><tpl> $langSysHtmlChannelRemark </tpl></span>
		<tpl> /if </tpl>
		</td>	
	</tr>
	<tr>
		<th class="th2"><tpl> $langIShopIndex </tpl>：</th>
		<td width="530" class="td1" colspan="3">  
		<tpl> if $config_index_html eq '1' </tpl><!-- 开启静态 -->
			<span class="btn_left"><input type="button" value="<tpl> $langIShopIndexCreateStatic </tpl>" onclick="make_html('index');" class="btn_submit"/></span>
		<tpl> else </tpl>
			<span style="color: #FF0000;font-weight: bold;"><tpl> $langSysHtmlIndexRemark </tpl></span>
		<tpl> /if </tpl>
		</td>	
	</tr>
	<tr>
		<td width="530" align="center" colspan="4">  
		<span style="color: #FF0000;font-weight: bold;"><tpl> $langSysHtmlRemark </tpl></span>
		</td>	
	</tr>
</table>
</div>
</div>
<!-- 帮助菜单 -->
<tpl> include file='sys_right_help.html' </tpl>
<!-- 帮助菜单END -->
</body>
</html>
<script language="javascript" type="text/javascript">

$(document).ready(function(){
	hideLoading();
})

function make_html(str){
	$.ajax({
		url: "html.manage.php",
		data: "action="+str,
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
		}
	});
	return false;
}
//更新缓存
function clean_cache(){
	$.ajax({
		url: "index.php",
		data: "action=clear_cache",
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
			//生成商品分类缓存文件
			product_class_restart();
			//生成地区缓存
			area_restart();
			//生成商品品牌缓存
			product_brand_restart();
		}
	});
	return false;
}

//生成商品分类缓存文件
function product_class_restart(){
	$.ajax({
		url: "pclass.manage.php",
		data: "action=restart",
		type:'post',
		dataType:"json"
	});
	return false;
}
//生成地区缓存
function area_restart(){
	$.ajax({
		url: "area.manage.php",
		data: "action=restartarea",
		type:'post',
		dataType:"json"
	});
	return false;
}

//生成商品品牌缓存
function product_brand_restart(){
	$.ajax({
		url: "product_brand.manage.php",
		data: "action=restart",
		type:'post',
		dataType:"json"
	});
	return false;
}


//基本栏目静态
function section_html(){
	$.ajax({
		url: "section.manage.php",
		data: 'action=section_html',
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
		}
	});
	return false; 
}

/* 频道静态 */function channel_html(){
	$.ajax({
		url: "html.manage.php",
		data: 'action=channel',
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
		}
	});
	return false; 
}



//新闻js静态
function news_html(){
	$.ajax({
			url: "news.manage.php",
			data: "action=make_all_js",
			type:'post',
			dataType:"json",
			beforeSubmit:  showLoading(showText),   // 提交之前执行的方法
			success: function(msg){
				hideLoading();
				showMessage(msg.message,msg.type);
			}
		});
		return false;
}

//广告JS调用
function adv_html(){
	$.ajax({
		url: "advertisement.manage.php",
		data: 'action=make_cache',
		type:'post',
		dataType:"json",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
		}
	});
	return false;
}


//全部生成静态
function all_cache(){
	news_html();
	adv_html();
	section_html();
	make_html('footer');
	make_html('link');
	<tpl> if $config_channel_html eq '1' </tpl><!-- 开启静态 -->
	channel_html();
	<tpl> /if </tpl>
	<tpl> if $config_index_html eq '1' </tpl><!-- 开启静态 -->
	make_html('index');
	<tpl> /if </tpl>
}
</script>